<?php
class Location_Types extends CI_Model{
	
	public function __construct(){
		parent::__construct();
		$this->load->database();
	}
	
	public function insertTypes($types){
		if($this->checkExist($types)){
			return FALSE;
		}else{
			$this->db->insert('location_types',$types);
			return TRUE;
		}
	}
	
	public function checkExist($types){
		$this->db->where('location_id',$types['location_id']);
		$this->db->where('type_name',$types['type_name']);
		if($this->db->count_all_results('location_types') > 0){
			return TRUE;
		}else{
			return FALSE;
		}
	}
}